package demo;

import java.io.File;

public class FileDemo {
	public static void main(String[] args) {
	String path = "C:"+File.separator;;
	File f = new File(path);
	print(f);

	}
	
	public static void print(File f){
		if(f!=null){
			if(f.isDirectory()){
				File files[] = f.listFiles();
				if(files!=null){
					for (int i = 0; i < files.length; i++) {
						print(files[i]);
					}
					
				}
				
			}else{
				
				System.out.println(f);
				
			}
			
			
			
			
		}
		
		
	}

}
